home *** CD-ROM | disk | FTP | other *** search
- /*
- File: WinUtils.h
-
- Contains: Utility functions for getting persistent window properties from a frame
-
- Owned by: Richard Rodseth
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #ifndef _WINUTILS_
- #define _WINUTILS_
-
-
- #ifndef _ODTYPES_
- #include <ODTypes.h>
- #endif
-
- //==============================================================================
- // Theory of operation
- //==============================================================================
-
- /*
-
- These functions allow a part editor to obtain the properties necessary to create
- a window, from the storage annotation on a root frame. BeginGetWindowProperties
- returns kODTrue if the annotation exists, and fills in the "properties" struct.
- EndGetWindProperties releases the sourceFrame field of the struct.
-
- Usage:
-
- WindowProperties props;
- ODWindow* window = kODNULL;
-
- if (BeginGetWindowProperties(ev, frame, &props))
- {
-
- ODPlatformWindow platformWindow = NewCWindow(kODNULL, &(props.boundsRect), props.title,
- kODFalse, props.procID, (WindowPtr)-1L, props.hasCloseBox, props.refCon);
-
- window = fSession->GetWindowState(ev)->RegisterWindowForFrame(ev, platformWindow,
- frame,
- props.isRootWindow, // Keeps draft open
- kODTrue, // Is resizable
- kODFalse, // Is floating
- kODTrue, // shouldSave
- props.sourceFrame);
- EndGetWindowProperties(ev, &props); // Release source frame
- }
-
- */
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- struct ODFrame;
-
- //==============================================================================
- // Function prototypes
- //==============================================================================
-
- struct WindowProperties
- {
- Rect boundsRect;
- Str255 title;
- ODSShort procID;
- ODBoolean hasCloseBox;
- ODSLong refCon;
- ODBoolean wasVisible;
- ODBoolean isResizable;
- ODBoolean isFloating;
- ODBoolean isRootWindow;
- ODBoolean shouldShowLinks;
- ODFrame* sourceFrame;
- };
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- ODBoolean BeginGetWindowProperties(Environment* ev, ODFrame* frame, WindowProperties* properties);
-
- // Obtains window properties from the storage unit referred to in the frame's
- // kODPropWindowProperties.
-
- void EndGetWindowProperties(Environment* ev, WindowProperties* properties);
-
- // Releases the source frame
-
- #ifdef __cplusplus
- } /* extern "C" */
- #endif
-
- #endif // _WINUTILS_
-